﻿using King.Box.Service;
using King.Box.WebApi.Providers.Impl;
using System;
using System.Web.Http;

namespace King.Box.WebApi.Controllers
{
#if !DEBUG
    [ClientAuthorize]
#endif
    public class MainController : ApiController
    {
        private readonly IDbInitService _dbInitService;
        public MainController(IDbInitService dbInitService)
        {
            _dbInitService = dbInitService;
        }

        [HttpGet]
        [AllowAnonymous]
        public string Index()
        {
            return "ok";
        }

        [HttpGet]
        [AllowAnonymous]
        public string InitDb()
        {
            _dbInitService.Init();
            return "ok";
        }
    }
}
